<?php 

class IndexAction extends BaseAction{
        function index(){
                //获取顶部时间
                $date=time();
                //获取天气
                
                //茶品牌厂商
                $where1='typeid=1 AND status=1';
                $list1=M('Links')->where($where1)->order('sort DESC')->select();
//                dump($list1);
                $count1=M('Links')->where($where1)->count();
                $this->assign('list1',$list1);
                $this->assign('count1',$count1);
                //获取其他所有链接
                $list2['parent']=M('links_type')->field('id AS t_id,type_name')->where('id<>1 AND hide=1 AND pid=0')->order('sort DESC')->select();
                foreach ($list2['parent'] as $k =>$v){
                        $list2['parent'][$k]['count']=D('Links')->getCounts('typeid='.$v['t_id']);
                        $list2['sub'][$v['t_id']]=M('Links')->where("logo=0 AND status=1 AND typeid=".$v['t_id'])->order('sort DESC')->select();
                }
//                dump($list2);exit();
                $this->assign("list2",$list2);
                //获取SEO
                $this->assign('seo', $this->seo);
                $this->display();
        }
}

?>